﻿using Framework.Models;
using Framework.Models.Entities;
using Framework.Models.Request;
using Framework.Utility.ViewModels;

namespace Flow.Manage.Contracts
{
    public interface IWorkFlowContract
    {
        #region Flowscheme

        /// <summary>
        /// 获取Flowscheme 列表
        /// </summary>
        /// <returns></returns>
        Task<TData<List<Fw_Flowscheme>>> GetFlowschemeList();

        /// <summary>
        /// 根据schemeId 获取 流程模板信息
        /// </summary>
        /// <param name="schemeId"></param>
        /// <returns></returns>
        Task<TData> GetFlowschemeById(string schemeId);

        TData<Fw_Flowscheme> FindFlowschemeByCode(string code);

        Task<TData> AddFlowScheme(Fw_FlowschemeRequest param);

        Task<TData> UpdateFlowscheme(Fw_FlowschemeRequest flowScheme);

        /// <summary>
        /// 删除流程模板
        /// </summary>
        /// <param name="schemeId">流程模板id</param>
        /// <returns></returns>
        Task<TData> DelFlowScheme(string schemeId);

        #endregion Flowscheme

        #region Flowinstance

        Task<TData<object>> GetFlowinstanceList();

        Task<TData<object>> GetFlowinstancebyId(string Id);

        TData AddFlowinstance(Fw_FlowinstanceRequest param);

        /// <summary>  注册审批流程  </summary>
        TData RegisterFlow(RegisterFlow model, object obj);
          
        TData UpdateFlowinstance(Fw_FlowinstanceRequest param);

        #endregion Flowinstance

        /// <summary>
        /// 审批
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        TData FlowApproval(ApprovalReqest param);

        /// <summary>
        /// 发起审批流程
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        TData FlowStart(string instanceId);

        /// <summary>
        /// 召回审批流程
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        TData FlowReCall(string instanceId);
    }
}